/**
 * @file   main.cpp
 * @author Zhao jingting <jtzhao@Zhao jingting.
 * @date   The Dec 14 17:00:23 2021
 *
 * @brief  A program to test.
 *
 *
 */

#include "QuickSort.h"
#include <vector>
#include <ctime>
using namespace std;

int main(int argc, char* argv[])
{
  srand(time(0));
  vector<int> b;
  int num;

  // Enter the length of the array and randomly generate elements
  cin>>num;
  for(int i=0;i<num;i++)
    {
      b.push_back(rand()%1000);
    }

  // Calculate the time cost
  clock_t start, finish;
  start = clock();
      quicksort_median(b);
      finish = clock();
      print(b);
      cout<<"the time cost of median3:"<<(double (finish )- double (start))<<endl;

      clock_t start1, finish1;
      start1 = clock();
        quicksort_random(b);
		finish1 = clock();
        print(b);
		cout<<"the time cost of random:"<<(double (finish1) - double( start1))<<endl;
        

}
